package com.quan.service;

import cn.hutool.core.bean.BeanUtil;
import com.quan.dao.OrderRepository;
import com.quan.entity.Order;
import com.quan.entity.OrderReq;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author: xiexinquan520@163.com
 * User: XieXinQuan
 * DATE:2020/8/3
 */
@Service
public class OrderService {
    @Resource
    OrderRepository orderRepository;

    public void createOrder(OrderReq orderReq){
        if (orderReq == null){
            return;
        }
        Order order = new Order();
        BeanUtil.copyProperties(orderReq, order);
        orderRepository.save(order);
    }
}
